
import hashlib

def encrpty(data):
    return hashlib.md5(data.encode()).hexdigest()

dict_data = {
    "brx": "123",
    "haha": "456",
    "a": {
        "qq": "111",
        "b": {
            "yu": "000",
            "c": "333"
        }
    }
}
# l1 = ["a.b.c", "brx"]

def fun(l1):
    global dict_data
    for i in l1:
        if "." not in i:
            dict_data[i] = encrpty(dict_data.get(i))
        else:
            l2 = i.split(".")
            dict_data_2 = dict_data
            l3 = []
            l3.append(dict_data)
            # print(dict_data)
            for j in l2:
                dict_data_2 = dict_data_2.get(j)
                l3.append(dict_data_2)
                if j == l2[-1]:
                    e1 = encrpty(dict_data_2)
                    l3.pop()
                    l3.append(e1)
            l3 = l3[::-1]
            l2 = l2[::-1]
            for n in range(len(l2)):
                l3[n+1][l2[n]] = l3[n]
            res_data = l3[-1]
            dict_data = res_data

    return dict_data



if __name__ == '__main__':
    l1 = ["a.b.yu", "brx"]
    res = fun(l1)
    print("result:", res)

